package com.mssh.entity.exception;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 熳殊沙华
 * @Date: 2025/03/25/12:43
 * @Description:
 */
public class BusinessException extends RuntimeException{
     private Integer code;  // 错误码
     private String msg;   // 错误信息

     public BusinessException(Integer code, String msg) {
         super(msg);
         this.code = code;
         this.msg = msg;
     }

     // 快速构建方法（推荐）
     public static BusinessException error(int code, String msg) {
         return new BusinessException(code, msg);
     }

     // Getter
     public Integer getCode() { return code; }
     public String getMsg() { return msg; }
 }
